/**
** Created by Kstar on 2022/1/12.
**/

//

#include "Plant.h"


int Plant::getGrowth() {
    return growth;
}

void Plant::setGrowth(int pgrowth) {
    growth = pgrowth;
}

void Plant::addGrowth(int nutrition) {//比如浇水给肥料可以增加营养值，根据浇水的量或次数设置营养值，人与植物的交互实现
    growth += nutrition;
}

string Plant::getColor() {
    return color;
}

void Plant::setColor(string pcolour) {
    color = pcolour;
}

string Plant::geName() {
    return name;
}

void Plant::setName(string pname) {
name = pname;
}

Plant::Plant(int cx, int cy, int cTime, int pgrowth, string pname, string pcolor) : Creature(cx, cy, cTime) {
    growth = pgrowth;
    name = pname;
    color = pcolor;
}

Plant::Plant(): Creature(0,0,0) {}